package urltool

import (
	"net/url"
	"path"

	"github.com/zeromicro/go-zero/core/logx"
)

func GetUrlPath(tarUrl string) (string, error) {
	myUrl, err := url.Parse(tarUrl)
	if err != nil {
		logx.Errorw("url.Parse error", logx.LogField{Key: "error", Value: err})
		return "", err
	}
	
	return path.Base(myUrl.Path), nil
}
